﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Windvoice.Blog;
using System.Diagnostics;
using Windvoice.Library;

namespace Windvoice.Controllers.Page
{
    public class HomeController : Windvoice.Framework.ControllerBase
    {
        //
        // GET: /Home/
        public ActionResult Index(int? page)
        {
            TextWriterHelper.WriteLine("c1",DateTime.Now);

            int RecordCount,PageIndex = page==null?1:page.Value,PageSize=13;
            ViewBag.BlogList = Article.GetList(PageIndex, PageSize, 0, out RecordCount);
            ViewBag.RecordCount = RecordCount;
            ViewBag.PageSize = PageSize;

            TextWriterHelper.WriteLine("c2", DateTime.Now);

            Article.CreateIndex(isForceRebuild:false);

            TextWriterHelper.WriteLine("c3", DateTime.Now);

            return View();
        }

        //public ActionResult Resume()
        //{
        //    IList<dynamic> Experience = new List<dynamic>();
        //    Experience.Add(new { start="2002.09",end="2006.07",company="",department="",title="" });

        //    return View();
        //}
        
        public ActionResult _404()
        {
            return View("_404");
        }
        public ActionResult _500()
        {
            return View("_500");
        }
        public ActionResult ie6()
        {
            return View("_ie6");
        }
    }
}
